//
//  StatusTableViewBottomView.swift
//  DSWeibo
//
//  Created by J on 16/4/30.
//  Copyright © 2016年 J. All rights reserved.
//

import UIKit

class StatusTableViewBottomView: UIView {
    override init(frame: CGRect) {
        super.init(frame: frame)
        //        self.backgroundColor = UIColor.orangeColor()
        //初始化UI
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    private func setupUI() {
        //添加子控件
        addSubview(backImageV)
        addSubview(retweetBtn)
        addSubview(commentBtn)
        addSubview(likeBtn)
        
        //布局子控件
        
        let superview = self
        
        retweetBtn.snp_makeConstraints { (make) in
            make.width.equalTo(superview).multipliedBy(1/3.0)
            make.height.equalTo(superview)
            make.left.equalTo(superview)
            make.top.equalTo(superview)
        }
        
        commentBtn.snp_makeConstraints { (make) in
            make.top.equalTo(retweetBtn)
            make.size.equalTo(retweetBtn)
            make.left.equalTo(retweetBtn.snp_right)
        }
        
        
        likeBtn.snp_makeConstraints { (make) in
            make.top.equalTo(commentBtn)
            make.size.equalTo(commentBtn)
            make.left.equalTo(commentBtn.snp_right)
        }
        
        backImageV.snp_makeConstraints { (make) in
            make.edges.equalTo(superview)
        }
        
        
        
        
        
    }
    //MARK: -- 懒加载 3个按钮
    
    //赞
    private lazy var backImageV: UIImageView = {
        let bgImageV = UIImageView()
        bgImageV.image = UIImage(named: "timeline_card_bottom_background")
        return bgImageV
    }()
    
    static let font = UIFont.systemFontOfSize(13)
    static let titleInset = UIEdgeInsetsMake(0, 20, 0, 0)
    //转发
    private lazy var retweetBtn: UIButton = UIButton.createButton("timeline_icon_retweet", title: "转发", font: 13, titleColor: UIColor.lightGrayColor());
    //评论
    private lazy var commentBtn: UIButton = UIButton.createButton("timeline_icon_comment", title: "评论", font: 13, titleColor: UIColor.lightGrayColor());
    
    //赞
    private lazy var likeBtn: UIButton = UIButton.createButton("timeline_icon_unlike", title: "赞", font: 13, titleColor: UIColor.lightGrayColor());


}